<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<c:set var="jpath" value="${pageContext.request.contextPath }"/>
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>Bootstrap表单组件 - Bootstrap后台管理系统模版Ace下载</title>
		<meta name="keywords" content="Bootstrap模版,Bootstrap模版下载,Bootstrap教程,Bootstrap中文" />
		<meta name="description" content="站长素材提供Bootstrap模版,Bootstrap教程,Bootstrap中文翻译等相关Bootstrap插件下载" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		
		<%@include file="css.jsp"%>
		<link rel="stylesheet" href="${jpath}/static/plugins/webuploader/css/webuploader.css" />
		<link rel="stylesheet" href="${jpath}/static/plugins/webuploader/style.css" />
	</head>

	<body>
						<div class="page-header">
							<h1>
								Form Elements
								<small>
									<i class="icon-double-angle-right"></i>
									Common form elements and layouts
								</small>
							</h1>
						</div><!-- /.page-header -->

						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->

								<form class="form-horizontal" method="post" id="stuForm" action="" role="form">
									<div class="form-group">
										<label class="col-sm-4 control-label no-padding-right" for="form-field-1"> 栏目名称 </label>

										<div class="col-sm-8">
											<input type="text" placeholder="栏目名称" id="name" name="columnName" value="${nc.columnName }" class="col-xs-10 col-sm-5" />
											<div>
												<input type="hidden" name="id" id="id" value="${nc.id}"/>
												<input type="hidden" name="ncurl" id="ncurl" value="${nc.ncurl}"/>
												<input type="hidden" name="imageInfo" id="imageInfo" value="${nc.imageInfo}"/>
												<input type="hidden" name="apprpId" id="apprpId" value=""/>
												<c:if test="${nc.createTime!=null}">
													<input type="hidden" name="createTime" id="createTime" value="${nc.createTime}"/>
												</c:if>
											</div>
										</div>
									</div>

								
									<div class="space-4"></div>
										<div class="form-group"> <div id="wrapper">
										        <div id="container">
										            <!--头部，相册选择和格式选择-->
										
										            <div id="uploader">
										                <div class="queueList">
										                    <div id="dndArea" class="placeholder">
										                        <div id="filePicker"></div>
										                        <p>或将照片拖到这里，单次最多可选300张</p>
										                    </div>
										                </div>
										                <div class="statusBar" style="display:none;">
										                    <div class="progress">
										                        <span class="text">0%</span>
										                        <span class="percentage"></span>
										                    </div><div class="info"></div>
										                    <div class="btns">
										                        <div id="filePicker2"></div><div class="uploadBtn">开始上传</div>
										                    </div>
										                </div>
										            </div>
										        </div>
										    </div>
										</div>
									<div class="space-4"></div>

											<div class="modal-footer" style="text-align: center;">
												<button class="btn btn-sm" data-dismiss="modal">
													<i class="icon-remove"></i>
													刷新
												</button>

												<button type="button" id="subBtn" class="btn btn-sm btn-primary">
													<i class="icon-ok"></i>
													提交
												</button>
											</div>
				</form>
							</div>
					</div>
<%@include file="js.jsp"%>
<script type="text/javascript" src="${jpath}/static/plugins/webuploader/dist/webuploader.js"></script>
<script type="text/javascript" src="${jpath}/static/plugins/webuploader/upload.js"></script>
<script type="text/javascript">
	$(function(){
		$("#subBtn").click(function(){
			var jsonForms = getForm("#stuForm");
			$.post("${jpath}/newsColumn/update",jsonForms,function(data){
				console.log(data);
				var json = $.parseJSON(data);
				alert(json.resMsg);
				if(json.resMsg=="修改成功"){
					location.href="${jpath}/newsColumnContent";
				};
				if(json.resMsg=="添加成功"){
					location.href="${jpath}/newsColumnContent";
				};
			});
		});
	});
</script>
</body>
</html>
